<template>
    <div>
      <el-dialog
        title="修改供应商品"
        :visible.sync="Visible">
        <el-form :model="supplys">
          <el-form-item label="商品名称">
            <el-input v-model="supplys.shop.shopName" readonly></el-input>
          </el-form-item>
          <el-form-item label="商品分类">
            <el-input v-model="supplys.shop.type.name" readonly></el-input>
          </el-form-item>
          <el-form-item label="供应价格">
            <el-input-number :min="1" v-model="supplys.supplierPrice" placeholder="请输入价格"></el-input-number>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" round style="width: 200px" @click="update">提交</el-button>
          </el-form-item>
        </el-form>
      </el-dialog>

    </div>
</template>

<script>
    export default {
        name: "Modification_of_commodity_supply",
      data(){
          return{
            Visible:false,
            supply:{id:""},
            supplys:{
              shop:{
                shopName:'',
                type:{
                  name:''
                }
              }
            }
          }
      },
      methods:{
        getdata(){
          this.$axios.get("supplierSupplyOfGoods/querybyid.action/"+this.supply.id).then(val=>{
            this.supplys=val.data;
          }).catch(error=>{})
        },
        update(){
          this.$axios.put("supplierSupplyOfGoods/updatebysupplierPrice.action",this.supplys).then(val=>{
            if (val.data.code>0){
              this.$message.success(val.data.msg);
              this.getdata();
              this.Visible=false
            }else {
              this.$message.error(val.data.msg)
            }
          }).catch(error=>{this.$message.error(error)})
        }
      }
    }
</script>

<style scoped>

</style>
